#include <iostream>
using namespace std;

class parent{
public:
	int age;
	parent() {

	}
	parent(int age) {
		this->age = age;
	}
	virtual int getAge() {
		cout << "父类" << endl;
		return age;
	}
};

class son_1:public parent{
public:
	int age;
    son_1() {

	}
    son_1(int age){
		this->age = age;
	}
	int getAge() {
		cout<<"son_1"<<endl;
		return age;
	}
};
class son_2:public parent{
public:
    int age;
    son_2(){

    }
    son_2(int age){
        this->age=age;
    }
    int getAge(){
        cout<<"son_2"<<endl;
        return age;
    }
};
int main() {
    son_1 s=son_1(18);

	parent *p = &s;
	cout<<p->getAge()<<endl;

//	while (1);
	return 0;
}